package com.oop.ch04;

/**
 * 宠物类---是所有宠物的父类
 */
public class Pet {
	//private 只能在本类中访问，
	private String type;//血统
	private String name;//昵称
	private String sex;//性别
	private int age;//年龄
	private double weight;//体重
	
	public Pet() {
	}
	
	public Pet(String type, String name, String sex, int age, double weight) {
		this.type = type;
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.weight = weight;
	}
	
	private void play(){
		System.out.println("娱乐");
	}
	
	
	//宠物的自我介绍
	public void print(){
		System.out.println("主人你好，我是可爱的"+this.getName()+"，今年"+age+"岁了，我是一只"+sex+"的"+type+"，体重"+weight+"公斤");
	}
	
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getSex() {
		return sex;
	}
	
	public void setSex(String sex) {
		this.sex = sex;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public double getWeight() {
		return weight;
	}
	
	public void setWeight(double weight) {
		this.weight = weight;
	}
}
